import React, { Component } from 'react';
import './scss/NoticeList.scss';
import $, { post } from 'jquery';
import { getData, getRealPath, getQueryVariable, putData1, delData, postData, putData } from '../../common/js/fetch';
import { message, Modal, Pagination, Select, Popover, Spin, DatePicker, Menu, Icon } from 'antd';
import {
    LgButton, LgSelect, LgBlockCard, LgBlockCardBox, LgDatePicker, LgSearch, LgPaginationA,
    LgBlockCardBoxProps, LgPopLayer, LgDrawer, LgInput, LgCheckbox, LgTextarea, LgSwitch, LgEmpty, LgLoadingDotRotation
} from 'lancoo-web-ui';
import 'element-theme-default';
import { Scrollbars } from 'react-custom-scrollbars';
import Base from './common/table/LgTable';
import CreateNotice from './CreateNotice';
import CollectSelectModal from "./common/collectSelectModal";
import moment from 'moment';
import Base64 from '../../common/js/fetch/base64'
import SelectUserModal from "lg-select-modal";
import { SKIN_BG_COLOR } from '../../hooks/useGetThem'
import { SKIN_DEFAULT_COLOR } from '../../hooks/useGetThem'
import { SKIN_HOVER_COLOR } from '../../hooks/useGetThem'
import { SKIN_BORDER_COLOR2 } from '../../hooks/useGetThem'


const { Option } = Select
const { SubMenu } = Menu;


class NoticeList extends Component {
    constructor(props) {
        super(props);
        const end = new Date();
        const start = new Date();
        start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
        this.state = {
            noticeList: [],
            typeList: [],//所有公告类型左侧导航
            typeList2: [],//所有公告类型类型列表
            typeList3: [],//负责类型
            userInfo: JSON.parse(sessionStorage.getItem('userInfo')),
            schoolInfo: JSON.parse(sessionStorage.getItem('schoolSystemInfo')),
            pageSizeList: [
                { text: "每页10条", Info: "Info写什么都可以", num: 10 },
                { text: "每页20条", Info: { a: "就是用来储存信息的" }, num: 20 },
                { text: "每页30条", Info: ["点击后会整个信息返回"], num: 30 },
            ],
            pageNum: 1,
            pageSize: 10,
            totalNoticeNum: 0,
            // demonstrationValue2: [start, end],
            demonstrationValue2: [],
            selectValue: '全部状态',
            datalistA: [
                {
                    text: "全部状态",
                    status: ''
                },
                {
                    text: "已发布",
                    status: '1'
                },
                {
                    text: "未发布",
                    status: '0'
                },
            ],
            popLayer01: false,
            popLayer02: false,
            popLayer03: false,
            advancedSettings: false,
            group: [
                // { label: '管理员', value: 6, checked: false },
                // { label: '领导', value: 8, checked: false },
                // { label: '学生', value: 2, checked: false },
                // { label: '家长', value: 3, checked: false },
                // { label: '其他', value: 11, checked: false },
            ],
            textareaRef: null,
            opened: false,
            typeId: '',
            typeId2: '',
            innerTypeId: '',
            releaseTypeId: '',
            releaseTypeId2: '',
            typeName: '',
            scope: [],
            remark: '',
            directorList: [],
            keyword: '',
            status: '',
            // startTime: moment(start).format('YYYY-MM-DD 00:00:00'),
            // endTime: moment(end).format('YYYY-MM-DD 23:59:59'),
            startTime: '',
            endTime: '',
            noticeDetail: {},
            noticeListInfo: [],
            noticeTitle: '',
            noticeContent: '',
            canViewPersonList: [0],
            releaseDepartment: [],
            attachmentsList: [],
            isTop: '0',
            isSynced: '0',
            devices: [],
            receiver: {},
            selectUserVisible: false,
            selectUserVisible1: false,
            selectUserList: [],
            totalNum: 0,
            receiverType: '',
            bulletinId: '',
            editId: '',
            openAddEvent: false,
            isInit: false,
            visibleView: false,
            serverTime: '',
            isManage: sessionStorage.getItem('isManage'),
            isSearch: false,
            officePlatform: JSON.parse(sessionStorage.getItem('officePlatform')),
            loading: false,
            departmentList: [],
            identityList: [],
            selectIdentityList: [],
            isChooseAll: false,
            releaseScope: [],
            isSuperAdmin: false,
            selectIdentityListOld: [],
            isAdvanced: sessionStorage.getItem('isAdvanced'),
            displayEndTime: new Date(),
        }

    }
    // 挂载后
    async componentDidMount() {
        this.setState({
            loading: true
        })
        let userInfo = this.state.userInfo;
        if (this.state.isAdvanced == 1 || (this.state.isManage === '1' && (userInfo.userType === '6' || (userInfo.userType === '0' && (userInfo.userClass === '2' || userInfo.userClass === '4'))))) {
            this.setState({
                isSuperAdmin: true
            })
        }
        if (this.state.isManage != '1') {
            this.setState({
                pageSizeList: [
                    { text: "每页8条", Info: "Info写什么都可以", num: 8 },
                    { text: "每页16条", Info: { a: "就是用来储存信息的" }, num: 16 },
                    { text: "每页24条", Info: ["点击后会整个信息返回"], num: 24 },
                ],
                pageSize: 8,
            })
        }
        await this.getNoticeList();
        await this.getIdentityList2()
        if (this.state) { //管理端直接初始化 2023-06-30
            let initTypeFinished = false;
            await this.initType().then(() => {
                initTypeFinished = true;
            });
            // if (initTypeFinished) {
            //     await this.getMyTypeList();
            // }
        } else {
            await this.getAllNoticeInfo(); //查看端直接左侧导航 2023-06-30
        }
        // if (this.state.isManage === '1' && (userInfo.userType === '6' || (userInfo.userType === '0' && (userInfo.userClass === '2' || userInfo.userClass === '4')))) {
        // if (this.state.isManage === '1' && userInfo.userType === '0') {
        //     await this.getTypeList();
        // } else {
        // await this.getAllNoticeInfo();
        // }
    }
    componentWillUnmount() {

    }

    //获取负责身份类型
    getIdentityList2 = () => {
        let {
            userInfo,
            selectIdentityListOld
        } = this.state
        console.log(selectIdentityListOld)
        getData("api/common/user/type", {
            eduId: userInfo.eduId,
            // userType: '0'
        })
            .then((res) => {
                return res.json()
            })
            .then((result) => {
                if (result.code == 200 && Array.isArray(result.data)) {
                    console.log('result', result);
                    let data = result.data;
                    let tempData = []
                    data.forEach(i => {
                        tempData.push({ label: i.userTypeName, value: i.identityCode, checked: false })
                    })
                    this.setState({
                        group: tempData
                    })
                } else {
                    message.error(json.msg, 3);
                }
            })
    }

    //初始化内置类型
    initType = async (key) => {
        putData1('/api/bulletin/inner_type/init', {
        }).then((res) => {
            return res.json()
        }).then((res) => {
            if (res.code == 200) {
                this.getTypeList(true, () => {
                    this.getAllNoticeInfo();
                });
            } else {
                message.error('初始化失败', 3);
            }
        })
    }
    clearTime = () => {
        // 在点击事件中编写处理代码
        if (this.state.startTime == '') return;
        this.setState({
            startTime: '',
            endTime: '',
            demonstrationValue2: [],
        }, () => this.getNoticeList())
    }

    GetExtensionFileName(pathfilename) {
        var reg = /(\\+)/g;
        var pfn = pathfilename.replace(reg, "#");
        var arrpfn = pfn.split("#");
        var fn = arrpfn[arrpfn.length - 1];
        var arrfn = fn.split(".");
        return arrfn[arrfn.length - 1];
    }

    //获取所有公告
    getNoticeList = async (sortType) => {
        let {
            userInfo,
            keyword,
            typeId,
            status,
            startTime,
            endTime,
            pageNum,
            pageSize,
            isManage
        } = this.state

        let url = '';
        let edu = JSON.parse(sessionStorage.getItem('userInfo'))
        if (isManage === '1') {
            url = `api/bulletin/creator/list/page/${pageNum}/${pageSize}`;
        } else {
            url = `api/bulletin/board/list/page/${pageNum}/${pageSize}`
        }
        sessionStorage.setItem('sortType', sortType ? sortType : '1')
        console.log(typeId, '666')
        console.log(userInfo)
        getData(url, {
            eduId: edu.eduId,
            keyword: encodeURIComponent(keyword),
            // typeId: '5',
            typeId: typeId === 'all' ? '' : typeId,
            status: isManage === '1' ? status : '1',
            startTime,
            endTime,
            sortType: sortType ? sortType : '1',
            // userId: userInfo.userType === '6' || (userInfo.userType === '0' && (userInfo.userClass === '2' || userInfo.userClass === '4')) ? '' : userInfo.userId,
            userId: userInfo.userId,
            userType: userInfo.userType,
            // identityCode: isManage === '1' ? getQueryVariable('lg_ic') : '',
            identityCode: userInfo.identityCode
        }).then((res) => {
            return res.json()
        }).then((json) => {
            if (json.code == 200 && Array.isArray(json.data)) {
                // console.log('json.data', json.data);
                //置顶排序
                let sortedData = json.data.sort((a, b) => {
                    if (a.status === '1' && a.seat === '1') {
                        return -1;
                    }
                    if (b.status === '1' && b.seat === '1') {
                        return 1;
                    }
                    if (a.status === '0') {
                        return -1;
                    }
                    if (b.status === '0') {
                        return 1;
                    }
                    if (a.readStatus === '0') {
                        return -1;
                    }
                    if (b.readStatus === '0') { //已读的排序靠后(修改)
                        return 1;
                    }
                    if (a.status === '1' && a.seat === '0') {
                        return -1;
                    }
                    if (b.status === '1' && b.seat === '0') {
                        return 1;
                    }
                    return 0;
                });
                this.setState({
                    noticeList: sortedData,
                    totalNoticeNum: Number(json.total)
                })
            } else {
                message.error(json.msg, 3);
            }
        })
    }

    //新版选择发布部门(第一级)
    getReleaseDep = async (departmentId) => {
        let {
            schoolInfo
        } = this.state
        let edu = JSON.parse(sessionStorage.getItem('userInfo'))
        let res = await getData("/api/constant/chief/departmentTree", {
            // sysId: schoolInfo.noticeSysId,
            eduId: edu.eduId,
            // departmentId
        });
        let result = await res.json();
        if (result.code == 200 && Array.isArray(result.data.departmentInfoVoList)) {
            let data = result.data.departmentInfoVoList;
            for (let i = 0; i < data.length; i++) {
                data[i].text = data[i].departmentName;
                //暂时隐藏二级部门
                // if (data[i].parentId == '' && data[i].childCount !== '0') {
                //     let sublist = await this.getReleaseDepNext(data[i].departmentId);
                //     data[i].sublist = sublist;
                // }
            }
            this.setState({
                departmentList: data
            })
        }
    }
    //新版选择发布部门(第二级)
    getReleaseDepNext = async (departmentId) => {
        let {
            schoolInfo
        } = this.state
        let edu = JSON.parse(sessionStorage.getItem('userInfo'))
        let res = await getData("/api/constant/chief/departmentTree", {
            // sysId: schoolInfo.noticeSysId,
            eduId: edu.eduId,
            // departmentId
        });
        let result = await res.json();
        if (result.code == 200 && Array.isArray(result.data.departmentInfoVoList)) {

            let data = result.data.departmentInfoVoList;
            console.log(data)
            data.forEach(item => {
                item.text = item.departmentName;
            })
            return data;
        }
    }

    //打开发布公告界面
    openRelease = async (type, id) => {
        let {
            typeList3,
            userInfo,
            departmentList,
            officePlatform
        } = this.state
        if (typeList3.length === 0) {
            if (userInfo.userType === '6' || (userInfo.userType === '0' && (userInfo.userClass === '2' || userInfo.userClass === '4'))) {
                message.warn('抱歉，您没有相应可发布类型权限，请先进行相应的发布权限类型设置!');
            } else if (sessionStorage.getItem('StandardEdition') === '0') {
                message.warn('抱歉，请先联系超级管理员开启发布类型!');
            } else {
                message.warn('抱歉，您没有相应可发布类型权限，请联系管理员开放发布权限!');
                // message.warn('抱歉，您没有相应可发布类型权限，请先进行相应的发布权限类型设置!');
            }
            return;
        }
        if (type === 'release') {
            this.setState({
                editId: ''
            })
        } else if (type === 'edit') {
            this.setState({
                editId: id
            })
        }
        if (departmentList.length == 0) {
            await this.getReleaseDep('');
        }
        this.getOfficePlatform(() => {
            this.setState({
                popLayer01: true,
                releaseTypeId: typeList3.length > 0 ? typeList3[0].typeId : ''
            }, () => {
                if (!officePlatform) {
                    this.getOfficePlatform();
                }
            });
        });
    }

    //增加阅读量并设置已读
    setRead = (bulletinId) => {
        putData1('api/bulletin/manage/read/increment', {
            bulletinId,
            userId: this.state.isManage === '1' ? '' : this.state.userInfo.userId
        }).then((res) => {
            return res.json()
        }).then((res) => {
            if (res.code == 200) {
                this.getNoticeList();
                // message.success('已读~');
            } else {
                message.error(res.msg, 3);
            }
        })
    }

    //发布/保存公告
    releaseNotice = (type) => {
        let {
            userInfo,
            schoolInfo,
            noticeTitle,
            releaseTypeId,
            canViewPersonList,
            releaseDepartment,
            noticeContent,
            attachmentsList,
            isTop,
            isSynced,
            devices,
            receiver,
            bulletinId,
            editId,
            typeId,
            releaseScope,
            typeList3,
            displayEndTime,
            releaseTypeId2
        } = this.state
        let innerTypeId = typeList3.find(item => item.typeId == releaseTypeId2)?.innerTypeId || null;
        let finishTime = moment(displayEndTime).format('YYYY-MM-DD 23:59:59');
        console.log(innerTypeId)
        console.log(finishTime)
        console.log(displayEndTime)
        console.log(releaseTypeId2)
        console.log(typeId)
        if (!noticeTitle || this.isStringEmpty(noticeTitle)) {
            message.warn('请输入公告标题！')
            return;
        }
        if (releaseDepartment.length === 0) {
            message.warn('请选择发布部门！')
            return;
        }
        if (!noticeContent || this.isStringEmpty(noticeContent)) {
            message.warn('请输入公告内容！')
            return;
        }
        if (innerTypeId == 3) {
            if (!finishTime) {
                message.warn('请选择结束时间！')
                return;
            }
        }
        if (attachmentsList.length > 0) {
            attachmentsList.forEach((item, index) => {
                item.orderNum = index
                item.name = item.fileName
                switch (item.type) {
                    case "document": item.type = '1';
                        break;
                    case "image": item.type = '2';
                        break;
                    case "audio": item.type = '3';
                        break;
                    case "video": item.type = '4';
                        break;
                    case "pack": item.type = '6';
                        break;
                    default: item.type = '5';
                        break
                }

            })
            console.log('attachmentsList', attachmentsList);

        }
        if (devices) {
            let devicesArr = devices
            devicesArr.forEach(item => {
                if (item.boardId) {//班牌
                    item.deviceType = '1';
                } else if (item.buildingBoardId) {//楼牌
                    item.deviceType = '2';
                } else {
                    item.deviceType = '3';
                }
                item.deviceId = item.boardId || item.buildingId || item.buildingBoardId;
                item.deviceName = item.boardName || item.buildingName || item.buildingBoardName;
            })
            receiver.devices = devicesArr
            receiver.grades = []
            receiver.classes = []
            receiver.allList = []
        }
        // console.log(devices, 'receiver', receiver);
        //2023-06-20新增 获取当前身份的ID以及Name
        console.log(userInfo)
        let identityCode = getQueryVariable('lg_ic'), identityInfos = userInfo.identityList;
        let userTypeName;
        for (let i = 0; i < identityInfos.length; i++) {
            if (identityInfos[i].identityCode === identityCode) {
                userTypeName = identityInfos[i].identityName;
                break;
            }
        }
        // console.log(identityCode,'identityCode',identityName);

        // return;
        let url = ''
        if (type === 'release') {
            url = 'api/bulletin/created/release' // 发布
        } else {
            url = 'api/bulletin/created/save'  //保存
        }
        //2023-06-30新增 发布只允许部分身份可查看
        let scopeArr = []
        console.log(releaseScope)
        releaseScope.forEach(item => {
            if (item.checked === true) {
                if (item.value === 0) {
                    scopeArr.push(0, 6, 7, 8);
                } else {
                    scopeArr.push(item.value);
                }
            }
        })
        console.log(scopeArr)
        if (scopeArr.length == 0) {
            message.warn('可查看对象不可为空!')
            return;
        }
        this.setState({ releaseTypeId: this.state.releaseTypeId2, typeId: this.state.typeId2 })
        postData(url, {
            bulletinId: editId,
            title: noticeTitle,
            content: noticeContent,
            typeId: this.state.releaseTypeId2,
            departmentId: releaseDepartment[0].departmentId,
            departmentName: releaseDepartment[0].departmentName,
            userId: userInfo.userId,
            userName: userInfo.userName,
            seat: isTop,
            pushOfficialWebsite: isSynced,
            sysId: schoolInfo.noticeSysId,
            way: '1',
            eduId: userInfo.eduId,
            eduName: userInfo.eduName,
            eduType: schoolInfo.schoolType,
            attachments: attachmentsList,
            receiver,
            identityCode,//2023-06-20新增
            identityName: userInfo.identityName,//2023-06-20新增
            scope: scopeArr,//2023-06-30新增
            displayEndTime: innerTypeId == 3 ? finishTime : '',//2025-05-30新增
        }).then((res) => {
            return res.json()
        }).then((json) => {
            if (json.code == 200) {
                message.success((type === 'release' ? '发布' : '保存') + '成功~');
                this.cancelType();
                this.hideModal();
                this.setState({
                    pageNum: 1,
                })
                this.getAllNoticeInfo(this.state.releaseTypeId2);
                this.getNoticeList()
                this.setState({
                    isInit: true,
                }, () => {
                    this.setState({
                        isInit: false,
                    })
                })
                // this.setState({
                //     typeId: 'all',
                //     pageNum: 1
                // }, () => {
                //     this.getNoticeList();
                // })
            } else {
                message.error(json.msg, 3);
            }
        })
    }

    //取消发布
    hideModal = () => {
        this.setState({
            noticeTitle: '',
            releaseTypeId: '',
            // canViewPersonList:[],
            releaseDepartment: [],
            noticeContent: '',
            attachmentsList: [],
            isTop: '0',
            isSynced: '0',
            devices: [],
            receiver: {},
            bulletinId: '',
            popLayer01: false,
            advancedSettings: false,
        })
    }

    //撤回公告
    callbackNotice = (bulletinId) => {
        putData1('/api/bulletin/manage/callback', {
            bulletinId
        }).then((res) => {
            return res.json()
        }).then((res) => {
            if (res.code == 200) {
                message.success('撤回成功~');
                this.setState({
                    pageNum: 1,
                }, () => {
                    this.getNoticeList();
                })
            } else {
                message.error(res.msg, 3);
            }
        })
    }

    //删除公告
    deleteNotice = (bulletinId) => {
        delData('/api/bulletin/manage/del', {
            bulletinId
        }).then((res) => {
            return res.json()
        }).then((res) => {
            if (res.code == 200) {
                message.success('删除成功~');
                this.setState({
                    pageNum: 1,
                }, () => {
                    this.getNoticeList();
                    this.getAllNoticeInfo(this.state.typeId);
                })
            } else {
                message.error(res.msg, 3);
            }
        })
    }

    //置顶公告
    toTop = (bulletinId, seat) => {

        putData1('/api/bulletin/manage/seat', {
            bulletinId,
            seat: seat === '1' ? '0' : '1'
        }).then((res) => {
            return res.json()
        }).then((res) => {
            if (res.code == 200) {
                this.setState({
                    pageNum: 1,
                }, () => {
                    this.getNoticeList();
                })
                // message.success('撤回成功~');
            } else {
                message.error(res.msg, 3);
            }
        })
    }

    //统计所有公告类型信息
    getAllNoticeInfo = async (typeId) => {
        let {
            userInfo,
            status,
            isManage
        } = this.state
        let allType = [{
            "typeId": "all",
            "typeName": "全部公告",
            "releasedNum": "0",
            "unReleaseNum": "0",
        }]
        let url = '';
        let edu = JSON.parse(sessionStorage.getItem('schoolSystemInfo'))
        if (isManage === '1') {
            url = 'api/bulletin/type/statistics/created/num'
        } else {
            url = 'api/bulletin/type/statistics/released/num'
        }
        getData(url, {
            eduId: userInfo.eduId,
            // userId: userInfo.userType === '6' || (userInfo.userType === '0' && (userInfo.userClass === '2' || userInfo.userClass === '4')) ? '' : userInfo.userId,
            userId: isManage === '1' ? userInfo.userId : '',
            // identityCode: isManage === '1' ? getQueryVariable('lg_ic') : '',//2023-06-19新增
            identityCode: userInfo.identityCode,
            userType: isManage === '1' ? '6' : '8',
            unloading: ''
            // status: userInfo.role === '管理员' ? status : '1',
        }).then((res) => {
            return res.json()
        }).then((json) => {
            if (json.code == 200 && Array.isArray(json.data)) {
                let typeArr = allType.concat(json.data);
                let total = typeArr.reduce((acc, cur) => {
                    if (cur.typeId !== 'all') {
                        let num = 0;
                        if (!cur.releasedNum) {
                            cur.releasedNum = 0
                        }
                        if (!cur.unReleaseNum) {
                            cur.unReleaseNum = 0
                        }
                        // if (cur.releasedNum && cur.unReleaseNum) {
                        num = Number(cur.releasedNum) + Number(cur.unReleaseNum);
                        // }
                        cur.totalNum = num;
                        return acc + num;
                    }
                    return acc;
                }, 0);
                typeArr.find(itm => itm.typeId === 'all').totalNum = total;// 输出修改后的数组
                if (typeId) {
                    this.setState({
                        noticeListInfo: typeArr,
                        typeId: typeId,
                        loading: false
                        // typeList: typeArr,
                    }, () => {
                        if (isManage === '1' && getQueryVariable('openCreate') == '1') {
                            this.openRelease('release');
                        }
                    })
                } else {
                    this.setState({
                        noticeListInfo: typeArr,
                        typeId: "all",
                        loading: false
                        // typeList: typeArr,
                    }, () => {
                        if (isManage === '1' && getQueryVariable('openCreate') == '1') {
                            this.openRelease('release');
                        }
                    })
                }
            } else {
                message.error(json.msg, 3);
            }
        })
    }
    //获取获取所有公告类型
    getTypeList = async (key, callback) => {
        let { userInfo, typeList, typeList2 } = this.state
        if (typeList2.length > 0 && key == 'get') {
            return;
        }
        try {
            const res = await getData('api/bulletin/all/type', {
                eduId: userInfo.eduId,
                state: this.state.isManage === '1' ? '' : '1'
            });
            const json = await res.json();
            if (json.code == 200) {
                let allType = [{
                    "typeId": "all",
                    "innerTypeId": "",
                    "typeName": "全部公告",
                    "scope": ["0", "1"],
                    "remark": "xxxxx",
                    "director": [{
                        "userId": "xx",
                        "userName": "xx",
                        "avatarPath": "xx"
                    }],
                    "state": "1",
                    "source": "1",
                    "schoolId": "xxxx"
                }]
                let typeArr = allType.concat(json.data);
                for (let i = 0; i < json.data.length; i++) {
                    if (!('directorList' in json.data[i])) {
                        json.data[i].directorList = [];
                    }
                }
                console.log(json.data)
                this.setState({
                    typeList: typeArr,
                    typeList2: json.data
                }, () => {
                    console.log('typeArr', typeArr);
                    // this.getAllNoticeInfo(true);
                    if (key) {
                        this.getMyTypeList(key);
                    }
                    if (callback) {
                        callback();
                    }
                })
            }
        } catch (error) {
            console.error(error);
        }
    }


    //获取当前用户负责的类型
    getMyTypeList = async (key) => {
        let {
            userInfo,
        } = this.state
        console.log('userInfo', userInfo);

        getData('api/bulletin/director/type', {
            eduId: userInfo.eduId,
            directorId: userInfo.userId,
            identityCode: userInfo.identityCode,//2023-06-19新增
            // directorId: userInfo.userType === '6' || (userInfo.userType === '0' && (userInfo.userClass === '2' || userInfo.userClass === '4')) ? '' : userInfo.userId
        }).then((res) => {
            return res.json()
        }).then((json) => {
            if (json.code == 200) {
                this.setState({
                    typeList3: json.data
                }, () => {
                    if (key === true) {
                        this.getNoticeList()
                    }
                })
            } else {
                message.error(json.msg, 3);
            }
        })
    }

    //添加/修改公告类型
    addType = () => {
        let {
            typeId,
            innerTypeId,
            typeName,
            scope,
            remark,
            userInfo,
            directorList,
            opened,
            group,
            selectUserList,
            selectIdentityList,
        } = this.state
        if (!typeName) {
            message.warn('请输入类型名称！');
            return;
        }
        if (this.isStringEmpty(typeName)) {
            message.warn('类型名称不能全为空格！');
            return;
        }
        if (!remark) {
            message.warn('请输入类型描述！');
            return;
        }
        if (this.isStringEmpty(remark)) {
            message.warn('类型描述不能全为空格！');
            return;
        }
        if (selectUserList.length === 0 && selectIdentityList.length === 0) {
            message.warn('请选择负责人或负责身份类型!');
            return;
        }
        let selectArr = Array.from(new Set(selectUserList));
        // console.log('selectArr',selectArr);
        let directorIds = [], directorIdentity = [];
        selectArr.forEach(item => {
            directorIds.push(item.userId);
            return directorIds;
        })
        selectIdentityList.forEach(item => {
            directorIdentity.push(item.identityCode);
        })
        // directorIdentity.push('IC0001')
        // console.log('directorIds', directorIds);
        // console.log('directorIdentity', directorIdentity);
        let scopeArr = scope.concat([]);
        group.forEach(item => {
            if (item.checked === true) {
                // if (item.value === 0) {
                //     scopeArr.push(0, 6, 7, 8);
                // } else {
                scopeArr.push(item.value);
                // }
            }
        })
        console.log(scopeArr)
        console.log('selectIdentityList', selectIdentityList);
        if (scopeArr.length === 0) {
            message.warn('请选择可查看对象！');
            return;
        }
        // return;
        postData('/api/bulletin/type/save', {
            typeId,
            innerTypeId,
            typeName,
            scope: scopeArr,
            remark,
            eduId: userInfo.eduId,
            state: opened === true ? '1' : '0',
            directorIds,
            directorIdentity,
            identityCode: userInfo.identityCode,
        }).then((res) => {
            return res.json()
        }).then((json) => {
            if (json.code == 200) {
                message.loading('正在' + (!typeId && !innerTypeId ? '添加' : '编辑'));
                this.getTypeList(true, () => {
                    this.getAllNoticeInfo(this.state.typeId);
                    message.success((!typeId && !innerTypeId ? '添加' : '编辑') + '成功~');
                });
                this.getNoticeList()
                this.setState({
                    popLayer03: false,
                    innerTypeId: '',
                }, () => { this.cancelType() })
            } else {
                message.error(json.msg, 3);
            }
        })
    }

    //修改类型
    editType = (obj) => {
        console.log('obj', obj);
        if (obj) {
            obj.directorList.forEach(item => {
                item.check = 2
                item.type = 'user'
            })
            let group = this.state.group;
            console.log(group)
            if (obj.canViewPeople) {
                group.forEach(item => {
                    let flag = false
                    obj.canViewPeople.forEach(itm => {
                        if (item.value == itm) {
                            item.checked = true;
                            flag = true
                        }
                        if (!flag) {
                            item.checked = false
                        }
                    })
                })
            }
            let arr = []; //编辑时删除超管2023-06-21
            if (obj.directorIdentityList) {
                arr = obj.directorIdentityList.filter(item => item.identityCode !== 'IC0001');
            }
            arr.forEach(item => {
                item.userName = item.identityName
                item.userTypeName = item.identityName
            })
            console.log(arr)
            this.setState({
                typeId: obj.typeId ? obj.typeId : '',
                innerTypeId: obj.innerTypeId ? obj.innerTypeId : '',
                typeName: obj.projectName,
                // scope: obj.canViewPeople,
                remark: obj.remark,
                opened: obj.status == '1' ? true : false,
                selectUserList: obj.directorList,
                totalNum: obj.directorList.length,
                group,
                selectIdentityList: arr,
                selectIdentityListOld: arr.concat([]),
            })

        } else {
            this.setState({
                typeId: '',
                innerTypeId: '',
            })
        }
        this.setState({ popLayer03: true })
    }

    //取消添加/修改公告类型
    cancelType = () => {
        this.setState({
            // typeId: '',
            innerTypeId: '',
            typeName: '',
            remark: '',
            popLayer03: false,
            opened: false,
            // group: [
            //     { label: '管理员', value: 6, checked: false },
            //     { label: '领导', value: 8, checked: false },
            //     // { label: '学生', value: 2, checked: false },
            //     // { label: '家长', value: 3, checked: false },
            //     // { label: '其他', value: 11, checked: false },
            // ],
            selectIdentityListOld: []
        })
        this.clear(1);
        this.clear(2);
    }

    //修改公告类型显隐状态
    setTypeState = async (typeId, innerTypeId, state) => {
        putData('/api/bulletin/type/update/state', {
            typeId,
            innerTypeId,
            state: state == '1' ? '0' : '1'
        }).then((res) => {
            return res.json()
        }).then((res) => {
            if (res.code == 200) {
                message.loading((state == '1' ? '正在关闭' : '正在启用') + '该公告类型~');
                this.getTypeList(true, () => {
                    this.getAllNoticeInfo(this.state.typeId);
                    message.success((state == '1' ? '已关闭' : '已启用') + '该公告类型~');
                });
            } else {
                message.error(res.msg, 3);
            }
        })
    }

    //删除公告类型
    delType = (typeId, innerTypeId) => {
        delData('/api/bulletin/type/del', {
            typeId,
            innerTypeId: innerTypeId ? innerTypeId : '',
        }).then((res) => {
            return res.json()
        }).then((res) => {
            if (res.code == 200) {
                message.loading('正在删除~');
                this.setState({
                    pageNum: 1,
                }, () => {
                    this.getTypeList(true, () => {
                        this.getAllNoticeInfo(this.state.typeId);
                        message.success('删除成功~');
                    });
                    this.getNoticeList();
                })
            } else {
                message.error(res.msg, 3);
            }
        })
    }



    // resize() {
    //     let page = $(personalRef.current);
    //     let InitWidth = 1920;
    //     let InitHeight = 1080;
    //     const resize = () => {
    //         let height = page.height();
    //         let width = page.width();
    //         console.log(height, width, '999');

    //         setRate([
    //             width / InitWidth,
    //             zoomType === "ratio" ? width / InitWidth : height / InitHeight,
    //         ]);
    //     };
    //     resize();
    //     window.addEventListener("resize", debounce(resize, 500), false);

    //     return () => {
    //         window.removeEventListener("resize", debounce(resize, 500));
    //     };
    // }


    //状态选择
    SelectOptionA = (item) => {
        console.log("选择的item:", item);
        this.setState({
            selectValue: item.text,
            status: item.status,
            pageNum: 1,
        }, () => {
            this.getNoticeList();
        })
    }
    //页码选择
    changePageA = (page) => {
        console.log('page', page);
        this.setState({
            pageNum: page
        }, () => {
            this.getNoticeList();
        })

    }
    pageSizeSelectA = (Data, index) => {
        console.log("data:", Data, "index:", index)
        this.setState({
            pageSize: Data.num,
            pageNum: 1
        }, () => {
            this.getNoticeList();
        })
    }


    //左侧导航
    handleClick = e => {
        console.log('click ', e);
        this.setState({
            typeId: e.key || this.state.typeId,
            pageNum: 1
        }, () => {
            this.getNoticeList();
        })
    };
    //添加类型的可查看对象
    onChange = (checked, index) => {
        let canViewList = this.state.group.concat([]);
        const newData = [...canViewList]
        canViewList[index].checked = checked
        this.setState({
            group: newData
        })
    }
    //获取选择的用户列表
    getSelectList1 = (obj) => {
        let receiveType = this.state.receiverType;
        let receiverType2 = [];
        const keyInfo = {
            "stu": "学生",
            "parent": "家长",
            "tea": "老师",
            "admin": "管理员",
            "org": "部门",
            "person": "个人"
        }
        if (Array.isArray(obj.groupList)) {
            obj.groupList.forEach((item) => {
                if (item.check == 2) {
                    if (item.exact) {
                        if (receiverType2.indexOf("全部" + keyInfo[item.id]) !== -1) {
                            return;
                        }
                        receiverType2.push("部分" + keyInfo[item.id]);
                        return;
                    }
                    if (receiverType2.indexOf("部分" + keyInfo[item.id]) !== -1) {
                        receiverType2.splice(receiverType2.indexOf("部分" + keyInfo[item.id]), 1);
                    }
                    receiverType2.push("全部" + keyInfo[item.id]);
                }
                if (item.check == 1) {
                    if (receiverType2.indexOf("全部" + keyInfo[item.id]) !== -1) {
                        return;
                    }
                    receiverType2.push("部分" + keyInfo[item.id]);
                }
            })
        }
        if (obj.persons && obj.persons.length > 0) {
            receiverType2.push("个人");
            obj.persons.forEach((item) => {
                if (!item.photoPath) {
                    item.photoPath = item.PhotoPath;
                }
            })
        }

        receiverType2 = [...new Set(receiverType2)].join("、");
        let updateStr = [];
        receiveType.split("、").forEach((item) => {
            if (
                item.indexOf("学生") === -1 &&
                item.indexOf("家长") === -1 &&
                item.indexOf("老师") === -1 &&
                item.indexOf("管理员") === -1 &&
                item.indexOf("部门") === -1 &&
                item.indexOf("个人") === -1) {
                updateStr.push(item);
            }
        })
        updateStr = updateStr.join("、");
        console.log(receiverType2 + (updateStr ? "、" : "") + updateStr);
        this.setState({
            receiverType: receiverType2 + (updateStr ? "、" : "") + updateStr,
            receiverInfo: obj,
            selectUserList: Array.isArray(obj.allList) ? obj.allList : []
        })
    }
    selectUserChange = (value) => {
        this.setState({
            selectUserVisible: value
        })
    }
    selectUserChange1 = (value) => {
        this.setState({
            selectUserVisible1: value
        })
    }
    deleteSelectedUser = (index) => {
        let {
            selectUserList
        } = this.state;
        let total = 0;
        selectUserList.splice(index, 1);
        selectUserList.forEach(item => {
            total += Number(item.totalCount);
            return total
        })
        this.setState({
            selectUserList,
            totalNum: total
        })
    }
    clear = (type) => {
        if (type === 1) {
            this.setState({
                selectUserList: [],
                totalNum: 0
            })
        } else {
            this.setState({
                selectIdentityList: [],
                selectIdentityListOld: [],
            })
        }
    }

    //跳转到详情
    openNoticeContent(id) {
        let token = getQueryVariable('lg_tk') || sessionStorage.getItem('token');
        // if (sessionStorage.getItem('isManage') != 1) {
        // this.setRead(id);
        // }
        let url = getRealPath() + '#/NoticeContent?lg_tk=' + token + '&bulletinId=' + id + '&lg_ic=' + getQueryVariable('lg_ic') + (sessionStorage.getItem('isManage') == 1 ? '&isManage=1' : '')
        window.open(url, '_blank');
        let $this = this;
        if (!this.state.openAddEvent) {
            this.setState({
                openAddEvent: true
            })
            this.addEvent(window, 'message', function (e) {
                try {
                    if (e.data === 1) {
                        $this.getNoticeList('');
                        // $this.setRead(id);
                    }
                } catch (ex) {
                }
            }, false);
        }
    }
    addEvent(elm, event, handler) {
        console.log(window.attachEvent, 'window.attachEvent', window.addEventListener);

        if (window.attachEvent) {
            elm.attachEvent("on" + event, handler);
        } else if (window.addEventListener) {
            elm.addEventListener(event, handler);
        } else {
            elm['on' + event] = handler;
        }
    }
    //预览公告
    previewNotice() {
        if (this.state.noticeTitle.length == 0) {
            message.error('公告标题不能为空~');
            return;
        }
        if (this.state.releaseTypeId == '' || this.state.releaseTypeId == undefined) {
            message.error('公告类型不能为空~');
            return;
        }
        if (this.state.releaseDepartment.length === 0) {
            message.error('请选择发布部门~');
            return;
        }
        if (this.state.noticeContent && this.state.noticeContent !== '<p><br></p>') {
            let myDate = moment().format('YYYY-MM-DD');
            this.setState({
                visibleView: true,
                serverTime: myDate
            })
        } else {
            message.error('公告内容不能为空');
        }
    }
    showhtml(htmlString) {
        var html = { __html: htmlString };
        return <div dangerouslySetInnerHTML={html}></div>;
    }
    downFile(url, name) {
        let data = this.state.data
        message.config({
            top: 50,
        })
        const hide = message.loading('正在下载，请稍等..', 0);
        var x = new XMLHttpRequest();
        // let url1 = sessionStorage.getItem('itemUrl') + url;
        console.log(url, 'url1');
        x.open("GET", url, true);
        x.responseType = 'blob';
        x.onload = function (e) {
            hide()
            var url = window.URL.createObjectURL(x.response);
            var a = document.createElement('a');
            a.href = url;
            a.download = name;
            a.click();
            URL.revokeObjectURL(url);
        }
        x.send();
    };

    //全部下载
    downloadFiles(files) {
        files.forEach(file => {
            fetch(file.url)
                .then(res => res.blob())
                .then(blob => {
                    saveAs(blob, file.name);
                });
        });
    }

    // 预览附件
    preViewFile(item) {
        let {
            schoolInfo
        } = this.state
        let filePath = item.url;
        filePath = filePath.replace(/[\\]+/g, '/');
        let base64 = new Base64();
        let url = encodeURIComponent(base64.encode(filePath));
        let previewIP = JSON.parse(sessionStorage.getItem("previewIP"));
        let webSvrAddr = previewIP[0].webSvrAddr;
        window.open(`${webSvrAddr}onlinePreview?url=${url}&eduId=${this.state.userInfo.eduId}`);

    }

    //打开高级设置时候，让发布窗口置顶
    toTopRelease = () => {
        if (this.state.advancedSettings) {
            $('.lg_popLayer_container').css('top', '74px');
        }
    }

    getSelectList = (obj) => {   //获取选择对象选择的用户列表 (新)
        this.setState({
            selectUserList: obj.selectUserList
        }, () => {

        })
    };

    //获取负责身份类型
    getIdentityList = () => {
        let {
            userInfo,
            selectIdentityListOld
        } = this.state
        console.log(selectIdentityListOld)
        getData("api/common/user/type", {
            eduId: userInfo.eduId,
            // userType: '0'
        })
            .then((res) => {
                return res.json()
            })
            .then((result) => {
                if (result.code == 200 && Array.isArray(result.data)) {
                    console.log('result', result);
                    let data = result.data;
                    this.setState({
                        identityList: data,
                        selectUserVisible1: true,
                        selectIdentityList: selectIdentityListOld.concat([])
                    })
                } else {
                    message.error(json.msg, 3);
                }
            })
    }
    //选择身份
    chooseIdentity = (obj) => {
        console.log('objobjobj', obj);
        let { selectIdentityList } = this.state
        let newList = [];
        let sign = 0;
        selectIdentityList.forEach((item) => {
            if (item.identityCode === obj.identityCode) { //已存在
                sign = 1;
            }
        })
        if (sign === 0) {
            selectIdentityList.push(obj);
            newList = selectIdentityList;
        } else {
            selectIdentityList.forEach((item) => {
                if (item.identityCode !== obj.identityCode) {
                    newList.push(item);
                }
            })

        }
        if (newList.length == this.state.identityList.length) {
            this.setState({
                isChooseAll: true
            })
        } else {
            this.setState({
                isChooseAll: false
            })
        }
        this.setState({
            selectIdentityList: newList
        })
    }
    // 选择全部身份
    chooseAll = () => {
        console.log(this.state.identityList)
        let { selectIdentityList } = this.state
        let newList = [];
        if (!this.state.isChooseAll) {
            this.state.identityList.forEach((item) => {
                console.log(item)
                newList.push(item)
            })
            this.setState({
                selectIdentityList: newList,
                isChooseAll: true
            })
        } else {
            this.setState({
                selectIdentityList: [],
                isChooseAll: false
            })
        }
    }
    deleteIdentity = (index, type) => {
        let {
            selectIdentityListOld,
            selectIdentityList
        } = this.state;
        if (type == 'all') {
            selectIdentityListOld.splice(index, 1);
        } else {
            selectIdentityList.splice(index, 1);
        }
        this.setState({
            selectIdentityList: type == 'all' ? selectIdentityListOld : selectIdentityList,
            selectIdentityListOld
        })
    }
    confirmIdentity = () => {
        let {
            selectIdentityList,
            selectUserVisible1
        } = this.state
        console.log('selectIdentityList', selectIdentityList);

        this.setState({
            selectIdentityListOld: selectIdentityList,
            selectUserVisible1: !selectUserVisible1
        })
    }

    //以防最开始的时候未获取到office-platform地址，所以当没有的时候来获取2023-06-21
    getOfficePlatform = (callback) => {
        if (this.state.officePlatform) { // 如果已经有 officePlatform，直接执行回调函数
            typeof callback === 'function' && callback();
        } else { // 否则调用 API 接口
            getData('api/commons/system/server/info', {
                sysId: '260'
            }).then(data => {
                return data.json()
            }).then(json => {
                if (json.code == "200" && json.data) {
                    this.setState({
                        officePlatform: json.data,
                    });
                    typeof callback === 'function' && callback(); // 执行回调函数
                }
            });
        }
    }

    //打开类型设置时判断是否存在office-platform地址
    openTypeSetting = () => {
        let {
            officePlatform
        } = this.state
        this.setState({
            popLayer02: true,
        }, () => {
            if (!officePlatform) {
                this.getOfficePlatform();
            }
        })
    }

    //检测是否全为空格
    isStringEmpty = (str) => {
        // 去除 HTML 标签
        var content = str.replace(/<(.*?)>/g, '');

        // 将 &nbsp; 替换为空格
        content = content.replace(/(&nbsp;|\s)+/g, ' ');

        // 去除空白字符
        content = content.trim();

        // 判断字符串是否为空
        return content.length === 0;
    }
    // 去掉字符串中的所有HTML标签和图片，只保留文字内容
    removeTagsAndImages = (htmlString) => {
        // 去除所有HTML标签
        let strippedText = htmlString.replace(/<[^>]+>/g, '');

        // 去除所有图片
        let textWithoutImages = strippedText.replace(/!\[.*?\]\(.*?\)/g, '');

        return textWithoutImages;
    }

    render() {
        let {
            noticeList,
            typeList,
            typeList2,
            typeList3,
            pageNum,
            pageSize,
            pageSizeList,
            totalNoticeNum,
            selectValue,
            datalistA,
            popLayer01,
            popLayer02,
            popLayer03,
            typeName,
            advancedSettings,
            group,
            remark,
            opened,
            userInfo,
            keyword,
            selectUserVisible,
            selectUserVisible1,
            selectUserList,
            totalNum,
            noticeListInfo,
            isInit,
            visibleView,
            noticeTitle,
            serverTime,
            noticeContent,
            releaseDepartment,
            releaseTypeId,
            attachmentsList,
            isManage,
            isSearch,
            typeId,
            officePlatform,
            loading,
            departmentList,
            identityList,
            selectIdentityList,
            isSuperAdmin,
            selectIdentityListOld,
            isAdvanced,
            isChooseAll
        } = this.state
        console.log('selectIdentityList', selectIdentityList);

        return (
            <LgBlockCardBox style={{
                backgroundColor: SKIN_BG_COLOR[sessionStorage.getItem('skin')]
            }} className={"g002-bg " + (loading ? 'is-loading' : '')}>
                {
                    // loading ?
                    //     <LgLoadingDotRotation size="small" />
                    //     :
                    <LgBlockCard
                        className="g002-blockCard"
                        title=" "
                    // supplement="我是补充信息"
                    // component={<div className="g002-blockCard-component"> 其他组件 </div>}
                    >
                        <div className="g002-blockCard-content">
                            {/* 左边 */}
                            <div className='content-left'>
                                <Scrollbars autoHeight autoHeightMax={710} autoHide autoHideTimeout={100}>
                                    <Menu
                                        onClick={this.handleClick}
                                        style={{ width: 162 }}
                                        defaultSelectedKeys={['all']}
                                        selectedKeys={[typeId]}
                                        defaultOpenKeys={['sub1']}
                                        mode="inline"
                                    >
                                        {
                                            noticeListInfo.map((item, index) => {
                                                return (
                                                    <Menu.Item title={item.typeName} key={item.typeId}>{item.typeName}<span className='type-item-num'>({item.totalNum})</span></Menu.Item>
                                                )
                                            })
                                        }

                                    </Menu>
                                </Scrollbars>
                            </div>
                            {/* 右边 */}
                            <div className='content-right'>
                                <div className='content-right-top'>
                                    <div className='top-left'>
                                        {
                                            isManage === '1' ?
                                                <LgSelect className='state-select' datalist={datalistA}
                                                    SelectOption={this.SelectOptionA}
                                                    value={selectValue} >
                                                </LgSelect>
                                                : ''
                                        }

                                        <div className='dates-picker'>
                                            <LgDatePicker className={isManage == 1 ? 'date-picker' : 'data-picker-user'} type="B"
                                                // value={[start, end]}
                                                disabledDate={time => time.getTime() > Date.now()}
                                                placeholder="选择日期范围"
                                                onChange={e => {
                                                    if (e instanceof Array) {
                                                        console.log("start:", e[0], "end:", e[1])
                                                        this.setState({
                                                            startTime: moment(e[0]).format('YYYY-MM-DD 00:00:00'),
                                                            endTime: moment(e[1]).format('YYYY-MM-DD 23:59:59'),
                                                            demonstrationValue2: [e[0], e[1]],
                                                            pageNum: 1,
                                                        }, () => this.getNoticeList());
                                                    } else {
                                                        this.clearTime();
                                                    }
                                                }}
                                                onRef={e => this.demonstrationPicker2 = e}
                                                align={"right"}
                                                value={this.state.demonstrationValue2}
                                                format={'yyyy/MM/dd'}
                                                shortcuts={[{
                                                    text: '最近一周',
                                                    onClick: () => {
                                                        const end = new Date();
                                                        const start = new Date();
                                                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);

                                                        this.setState({
                                                            startTime: moment(start).format('YYYY-MM-DD 00:00:00'),
                                                            endTime: moment(end).format('YYYY-MM-DD 23:59:59'),
                                                            demonstrationValue2: [start, end],
                                                            pageNum: 1,
                                                        }, () => this.getNoticeList())
                                                        this.demonstrationPicker2.togglePickerVisible()
                                                    }
                                                }, {
                                                    text: '最近一个月',
                                                    onClick: () => {
                                                        const end = new Date();
                                                        const start = new Date();
                                                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);

                                                        this.setState({
                                                            startTime: moment(start).format('YYYY-MM-DD 00:00:00'),
                                                            endTime: moment(end).format('YYYY-MM-DD 23:59:59'),
                                                            demonstrationValue2: [start, end],
                                                            pageNum: 1,
                                                        }, () => this.getNoticeList())
                                                        this.demonstrationPicker2.togglePickerVisible()
                                                    }
                                                }, {
                                                    text: '最近三个月',
                                                    onClick: () => {
                                                        const end = new Date();
                                                        const start = new Date();
                                                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
                                                        this.setState({
                                                            startTime: moment(start).format('YYYY-MM-DD 00:00:00'),
                                                            endTime: moment(end).format('YYYY-MM-DD 23:59:59'),
                                                            demonstrationValue2: [start, end],
                                                            pageNum: 1,
                                                        }, () => this.getNoticeList())
                                                        this.demonstrationPicker2.togglePickerVisible()
                                                    }
                                                }]}
                                            />
                                        </div>
                                        <span className='total-num'>共<span className='total-num-number'>{totalNoticeNum}</span>条</span>
                                    </div>
                                    <div className='top-right'>
                                        <LgSearch className='top-right-search'
                                            value={keyword}
                                            input={{
                                                placeholder: isManage === '1' ? '搜索发布者或标题' : '搜索发布部门或标题',
                                                onChange: (e) => this.setState({ keyword: e.target.value.replace('%', ' ').replace('_', ' ') }),
                                                onKeyPress: (e) => {
                                                    if (e.key === 'Enter') {
                                                        this.setState({
                                                            isSearch: true,
                                                            pageNum: 1,
                                                        }, () => this.getNoticeList())
                                                    }
                                                },
                                                autoComplete: 'off'
                                            }}
                                            onClear={() => this.setState({ keyword: '', isSearch: false, pageNum: 1, }, () => this.getNoticeList())}
                                            onSearch={() => this.setState({ isSearch: true, pageNum: 1, }, () => this.getNoticeList())} ></LgSearch>
                                        {
                                            isManage === '1' ?
                                                <>
                                                    {
                                                        // userInfo.userType === '6' || (userInfo.userType === '0' && (userInfo.userClass === '2' || userInfo.userClass === '4')) ?
                                                        // userInfo.userType === '6' || (userInfo.userType === '0') ?
                                                        isSuperAdmin ?
                                                            <LgButton className='top-right-type' backgroundType='opacification' type='info' onClick={() => { this.openTypeSetting(); this.getTypeList('get') }}>{isSuperAdmin ? '类型设置' : '类型查看'}</LgButton>
                                                            : ''
                                                    }
                                                    <LgButton className='top-right-publish' backgroundType='opacification' showIcon
                                                        icon={<LgButton.icon.Add></LgButton.icon.Add>} type='success' onClick={() => {
                                                            this.openRelease('release')
                                                        }}>发布公告</LgButton></>
                                                : ''
                                        }
                                    </div>
                                    <LgPopLayer
                                        width='950px'
                                        // height={advancedSettings ? '864px' : '643px'}
                                        height={advancedSettings ? '764px' : '643px'}
                                        className='create-notice'
                                        title="发布公告"
                                        isOpen={popLayer01}
                                        // isOpen={true}
                                        isShowBottom={false}
                                        // customOfBottom={[
                                        //     <span className='preview' key='test1' onClick={() => { this.previewNotice() }}>预览</span>,
                                        //     <LgButton className='save-btn' key='test2' backgroundType='opacification' type='success' onClick={() => this.releaseNotice('save')}>保存</LgButton>,
                                        //     <LgButton className='release-btn' key='test3' backgroundType='opacification' type='info' onClick={() => this.releaseNotice('release')}>确定</LgButton>,
                                        //     <LgButton className='cancel-btn' key='tes4' backgroundType='translucent' border type='info' onClick={() => { this.hideModal() }}>取消</LgButton>,
                                        // ]}
                                        customOfBottom={<div className='myBtn' style={{
                                            backgroundColor: SKIN_BG_COLOR[sessionStorage.getItem('skin')]
                                        }}>
                                            <span className='preview' key='test1' onClick={() => { this.previewNotice() }}>预览</span>
                                            <LgButton className='save-btn' key='test2' backgroundType='opacification' type='success' onClick={() => this.releaseNotice('save')}>保存</LgButton>
                                            <LgButton className='release-btn' key='test3' backgroundType='opacification' type='info' onClick={() => this.releaseNotice('release')}>确定</LgButton>
                                            <LgButton className='cancel-btn' key='tes4' backgroundType='translucent' border type='info' onClick={() => { this.hideModal() }}>取消</LgButton>
                                        </div>}
                                        onIconClose={() => { this.hideModal() }}
                                        onShowLayer={() => {
                                        }}>
                                        {
                                            popLayer01 ?
                                                // true?
                                                <CreateNotice setNoticeTitle={(e) => this.setState({ noticeTitle: e })}
                                                    setNoticeContent={(e) => this.setState({ noticeContent: e })}
                                                    setIsTop={(top) => this.setState({ isTop: top })}
                                                    setIsSynced={(Sync) => this.setState({ isSynced: Sync })}
                                                    setReleaseTypeId={(id => this.setState({ releaseTypeId2: id, typeId2: id }, () => console.log('typeId', this.state.typeId)
                                                    ))}
                                                    setReleaseDepartment={(arr) => this.setState({ releaseDepartment: arr })}
                                                    setAttachmentsList={(arr) => this.setState({ attachmentsList: arr })}
                                                    setReceiver={(obj) => this.setState({ receiver: obj })}
                                                    setDevices={(arr) => this.setState({ devices: arr })}
                                                    typeList={typeList3}
                                                    editId={this.state.editId}
                                                    setAdvanced={(bol) => this.setState({ advancedSettings: bol ? bol : !advancedSettings }, () => this.toTopRelease())} isAdvanced={advancedSettings}
                                                    isInit={isInit}
                                                    departmentList={departmentList}
                                                    officePlatform={officePlatform}
                                                    typeId={this.state.typeId}
                                                    setReleaseScope={(scope) => this.setState({ releaseScope: scope })}
                                                    setDisplayEndTime={(time) => this.setState({ displayEndTime: time })}
                                                />
                                                : ''
                                        }
                                    </LgPopLayer>
                                    <LgPopLayer
                                        width='1238px'
                                        height='643px'
                                        className='preview-notice'
                                        title="预览公告"
                                        isOpen={visibleView}
                                        isShowBottom={false}
                                        onIconClose={() => { this.setState({ visibleView: false }) }}
                                    >
                                        {
                                            visibleView ?
                                                <div className='preview-info'>
                                                    <div className='preview-info-top'>
                                                        <h1>{noticeTitle}</h1>
                                                        <div className='notice-details-message'><span > <i className='publish-icon publish-icon-time'> </i>{serverTime}</span>
                                                            <span > <i className='publish-icon publish-icon-dep'></i>{releaseDepartment[0].departmentName}</span><span><i className='publish-icon publish-icon-type'> </i>{typeList3.map(item => {
                                                                if (releaseTypeId === item.typeId) {
                                                                    return (
                                                                        item.typeName
                                                                    )
                                                                }
                                                            })} </span>
                                                            <span><i className='publish-icon publish-icon-read'></i>{'0'}</span></div>
                                                    </div>
                                                    <div className="notice-content ">{this.showhtml(noticeContent)}</div>
                                                    {attachmentsList.length > 0 ? <div className="notice-down-box" >
                                                        <p style={{ marginBottom: '15px', display: 'flex' }}>附件({attachmentsList.length}个)
                                                            <div className='download-all'
                                                                onClick={() => this.downloadFiles(attachmentsList)}>全部下载</div>
                                                        </p>
                                                        {/* <Scrollbars autoHeight autoHeightMax={180} autoHide autoHideTimeout={100}> */}
                                                        {
                                                            attachmentsList.map(item => {
                                                                console.log('item', item);

                                                                return (
                                                                    <div className="notice-down-message">
                                                                        <div className='file-info'>
                                                                            <i className={`file-icon file-icon-${this.GetExtensionFileName(item.fileName)}`}></i>
                                                                            <p className='file-name' title={item.fileName.length > 60 ? item.fileName : ''}>{item.fileName.length > 60 ? item.fileName.slice(0, 58) + '..' : item.fileName}</p>
                                                                            <span className='file-size'>{(item / 1024 / 1024) >= 1 ? (item.size / 1024 / 1024).toFixed(1) + 'MB' : (item.size / 1024).toFixed(1) + 'KB'}</span>
                                                                        </div>
                                                                        <div>
                                                                            <LgButton onClick={() => this.preViewFile(item)} split shapeType='text' type='info'>预览</LgButton>
                                                                            <LgButton onClick={() => { this.downFile(item.url, item.fileName); }} split shapeType='text' type='info'>下载</LgButton>
                                                                        </div>
                                                                        {/* <b className='down-file' href={item.url.indexOf('.mp4') === -1 && item.url.indexOf('.mp4') === -1 ? item.url : item.url + '?fileName=' + item.name.slice(0, -4)} download={item.name} onClick={() => { this.downFile(item.url, item.name); }}>下载</b> */}
                                                                    </div>
                                                                )
                                                            })
                                                        }
                                                        {/* </Scrollbars> */}

                                                    </div> : ''}
                                                </div>

                                                : ''
                                        }
                                    </LgPopLayer>
                                    <LgPopLayer
                                        width='1238px'
                                        height={'757px'}
                                        className='type-setting lg-skin-s2'
                                        title={isSuperAdmin ? '类型设置' : '类型查看'}
                                        isOpen={popLayer02}
                                        isShowBottom={false}
                                        onShowLayer={() => {
                                            this.getNoticeList()
                                            this.setState({
                                                popLayer02: false
                                            }, () => this.cancelType())
                                        }}>
                                        <div className='type-top'>
                                            共<span className='type-num'>{typeList2.length}</span>个
                                            {
                                                isAdvanced == 1 || (sessionStorage.getItem('StandardEdition') === '1' && (userInfo.userType === '6' || (userInfo.userType === '0' && (userInfo.userClass === '2' || userInfo.userClass === '4')))) ?
                                                    <LgButton className='type-top-right' backgroundType='opacification' showIcon
                                                        icon={<LgButton.icon.Add></LgButton.icon.Add>} type='success'
                                                        onClick={() => this.editType()}>添加类型</LgButton>
                                                    : ''
                                            }

                                        </div>
                                        <div className={typeList2.length === 0 ? 'type-bottom' : ''}>
                                            {
                                                typeList2.length === 0 ?
                                                    <LgEmpty className="empty-example-block" size="large" /> :
                                                    <Base getNoticeList={this.getNoticeList} type={'typeSet'} typeList={typeList2} setTypeState={this.setTypeState}
                                                        delType={this.delType} editType={this.editType}></Base>
                                            }
                                        </div>
                                        <LgDrawer
                                            cover
                                            title={typeId !== '' ? "编辑类型" : "添加类型"}
                                            type={"right"}
                                            style={{ position: "absolute" }}
                                            zIndex={20000}
                                            visible={popLayer03}
                                            closeBtn={this.cancelType}
                                            checkBtn={
                                                this.addType
                                            }
                                            className="pop_seven drawer-modal"
                                            width={650}
                                            darken={false}
                                        >
                                            <div className='drawer-container'>
                                                <div className='type-name'>
                                                    <span className='type-span'><span className='must-fill'>*</span>类型名称:</span>
                                                    <LgInput
                                                        onChange={
                                                            (e) => {
                                                                this.setState({
                                                                    typeName: e.currentTarget.value
                                                                })
                                                            }
                                                        }
                                                        value={this.state.typeName}
                                                        maxLength={8}
                                                        style={{ width: 481 }}
                                                        placeholder='请输入类型名称...'>
                                                    </LgInput>
                                                    <span className='input-num'>{typeName.length}/8</span>
                                                </div>
                                                <div className='can-view-person'>
                                                    {/* <span className='must-fill'>*</span> */}
                                                    <span className='type-span type-can-views'>
                                                        <span className='span-tips' title='勾选上的用户角色，才可以查看该公告内容。'></span>
                                                        <span className='must-fill'>*</span>
                                                        可查看对象:
                                                    </span>
                                                    <div className='person-check-box'>
                                                        {
                                                            group.map((item, index) => (
                                                                <LgCheckbox className={index === 4 ? "g006-form-1-item g006-form-1-item-other" : "g006-form-1-item"} key={"checkbox" + index} checked={item.checked} onChange={this.onChange} value={index} label={item.label} />
                                                            ))
                                                        }
                                                        {/* <span className='span-tips' title='包含其他教职工和临时用户等用户。'></span> */}
                                                    </div>
                                                </div>
                                                <div className='type-describe'>
                                                    <span className='type-span'>
                                                        <span className='must-fill'>*</span>
                                                        描述:
                                                    </span>
                                                    <LgTextarea placeholder='请输入类型详细描述...'
                                                        style={{ width: '480px', height: '112px' }}
                                                        textarea={{
                                                            onInput: (e) => {
                                                                this.setState({
                                                                    remark: e.currentTarget.value
                                                                })
                                                            },
                                                            maxLength: 200,
                                                        }}
                                                        value={this.state.remark}
                                                        numberOfWords
                                                        currentTextQuantity={remark.length}
                                                        onRef={(ref) => {
                                                            if (ref && ref.current) { ref.current.value = remark }
                                                            this.setState({
                                                                textareaRef: ref
                                                            })
                                                        }}
                                                    ></LgTextarea>
                                                </div>
                                                <div className='principal-person'>
                                                    <div className='principal-person-left'>
                                                        <span className='type-span'>
                                                            <span className='must-fill'>*</span>
                                                            负责人:
                                                        </span>
                                                    </div>
                                                    <div className='principal-person-right'>
                                                        <div className='principal-right-top'>
                                                            {
                                                                selectUserList.length > 0 ? selectUserList.slice(0, 6).map((item, index) => {
                                                                    return (
                                                                        <div className='selected-one' key={index}>{item.name || item.userName}
                                                                            {
                                                                                item.userId ?
                                                                                    <span style={{
                                                                                        color: "#999"
                                                                                    }}>({item.userId})</span> :
                                                                                    item.groupType ?
                                                                                        <>
                                                                                            <span style={{
                                                                                                color: "#999"
                                                                                            }}>({groupTypeInfo[item.groupType]})</span>
                                                                                            <span style={{
                                                                                                color: "#999"
                                                                                            }}>({item.totalCount}人)</span>
                                                                                        </>
                                                                                        :
                                                                                        ""
                                                                            }
                                                                            <i className="delete-logo" onClick={() => this.deleteSelectedUser(index)}></i>
                                                                        </div>
                                                                    )
                                                                }) : ''
                                                            }
                                                            {
                                                                selectUserList.length > 6 ?
                                                                    <span style={{ float: "left", margin: "0 5px", fontSize: "20px", lineHeight: "20px" }}>...</span> :
                                                                    ""
                                                            }
                                                        </div>

                                                        <div className='principal-right-bottom' style={{ marginTop: selectUserList.length === 0 ? '40px' : '' }}>
                                                            {
                                                                selectUserList.length > 0 ?
                                                                    // <>已选<span className='principal-person-num'>{totalNum}</span>人
                                                                    <>已选<span className='principal-person-num'>{selectUserList.length}</span>人
                                                                        <LgButton onClick={() => this.clear(1)} className='principal-empty' size='mini' backgroundType='translucent' border type='fail'>清空</LgButton></>
                                                                    : ''
                                                            }
                                                            <LgButton size='mini' onClick={() => {
                                                                this.setState({ selectUserVisible: true });
                                                            }} backgroundType='translucent' border type='info'>选择</LgButton>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div className='principal-person principal-person-identityCode'>
                                                    <div className='principal-person-left'>
                                                        <span className='type-span'>
                                                            {/* <span className='span-tips' title='勾选上的身份类型，该身份类型的所有人都可以管理该类型。'></span> */}
                                                            <span className='must-fill'>*</span>
                                                            负责身份类型:
                                                        </span>
                                                    </div>
                                                    <div className='principal-person-right'>
                                                        <div className='principal-right-top'>
                                                            {
                                                                selectIdentityListOld.length > 0 ? selectIdentityListOld.slice(0, 6).map((item, index) => {
                                                                    if (item.identityCode === 'IC0001') return
                                                                    return (
                                                                        <div className='selected-one' key={index}>{item.userTypeName}
                                                                            {
                                                                                item.userId ?
                                                                                    <span style={{
                                                                                        color: "#999"
                                                                                    }}>({item.userId})</span> :
                                                                                    item.groupType ?
                                                                                        <>
                                                                                            <span style={{
                                                                                                color: "#999"
                                                                                            }}>({groupTypeInfo[item.groupType]})</span>
                                                                                            <span style={{
                                                                                                color: "#999"
                                                                                            }}>({item.totalCount}人)</span>
                                                                                        </>
                                                                                        :
                                                                                        ""
                                                                            }
                                                                            <i className="delete-logo" onClick={() => this.deleteIdentity(index, 'all')}></i>
                                                                        </div>
                                                                    )
                                                                }) : ''
                                                            }
                                                            {
                                                                selectIdentityListOld.length > 6 ?
                                                                    <span style={{ float: "left", margin: "0 5px", fontSize: "20px", lineHeight: "20px" }}>...</span> :
                                                                    ""
                                                            }
                                                        </div>

                                                        <div className='principal-right-bottom' style={{ marginTop: selectIdentityListOld.length === 0 ? '40px' : '' }}>
                                                            {
                                                                selectIdentityListOld.length > 0 ?
                                                                    <>已选<span className='principal-person-num'>{selectIdentityListOld.length}</span>类
                                                                        <LgButton onClick={() => this.clear(2)} className='principal-empty' size='mini' backgroundType='translucent' border type='fail'>清空</LgButton></>
                                                                    : ''
                                                            }
                                                            <LgButton size='mini' onClick={() => {
                                                                this.getIdentityList();
                                                                // this.setState({
                                                                //     selectUserVisible1:true
                                                                // })
                                                            }} backgroundType='translucent' border type='info'>选择</LgButton>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div className='is-open'>
                                                    <span className='type-span'>
                                                        是否开启:
                                                    </span>
                                                    <LgSwitch checked={opened} onClick={() => { this.setState({ opened: !opened }) }} ></LgSwitch>
                                                    <span className='is-open-describe'>启用后，负责人或所选负责身份类型可以发布该类型的公告</span>
                                                </div>
                                            </div>
                                        </LgDrawer>
                                    </LgPopLayer>
                                </div>
                                <LgPopLayer
                                    className='select-obj lg-skin-s2'
                                    title="负责身份类型选择"
                                    isOpen={selectUserVisible1}
                                    centered
                                    width='900px'
                                    height='640px'
                                    customOfBottom={[
                                        <LgButton style={{
                                            backgroundColor: SKIN_DEFAULT_COLOR[sessionStorage.getItem('skin')], opacity: selectIdentityList.length > 0 ? '1' : '0.5'
                                        }} disable={selectIdentityList.length > 0 ? false : true} className='confirm-btn' key='test3' backgroundType='opacification' type='info' onClick={this.confirmIdentity}>确定</LgButton>,
                                        <LgButton style={{
                                            border: `1px solid ${SKIN_BORDER_COLOR2[sessionStorage.getItem('skin')]}`,
                                            color: `${SKIN_HOVER_COLOR[sessionStorage.getItem('skin')]}`,
                                            backgroundColor: 'white'
                                        }} className='cancel-btn' key='tes4' backgroundType='translucent' border type='info' onClick={() => { this.setState({ selectUserVisible1: false, }); }}>取消</LgButton>,
                                    ]}
                                    onIconClose={() => {
                                        this.setState({ selectUserVisible1: false });
                                    }}
                                >
                                    <div className="select-container">
                                        <div className="select-left">
                                            <div className="selected-object">
                                                {
                                                    selectIdentityList.map((item, index) => {
                                                        return (
                                                            // <LgCheckbox
                                                            //     className={index === 4 || item.label == '其他' ? "g006-form-1-item g006-form-1-item-other" : "g006-form-1-item"}
                                                            //     key={"checkbox" + index} checked={item.checked}
                                                            //     onClick={() => this.deleteIdentity(index, 'no')}
                                                            //     value={index}
                                                            //     label={item.label} />

                                                            <div key={index} className="selected-list-one">
                                                                {item.userTypeName}
                                                                <span className="cancellogo" onClick={() => this.deleteIdentity(index, 'no')}></span>
                                                            </div>
                                                        )
                                                    })
                                                }

                                            </div>

                                        </div>

                                        <div className="select-right">
                                            <div style={{ paddingLeft: '20px', }}>
                                                {
                                                    identityList.length > 0 ?
                                                        '' :
                                                        <div style={{
                                                            display: 'inline-block',
                                                            height: '200px',
                                                            position: 'relative',
                                                            top: '100px',
                                                            left: '93px',
                                                            color: '#999999'
                                                        }}>暂无可选身份类型</div>
                                                }
                                                <Scrollbars autoHeight autoHeightMax={592} autoHide autoHideTimeout={100}>
                                                    <ul className="child-list">
                                                        {
                                                            identityList.length > 0 ?
                                                                identityList.map((item, index) => {
                                                                    let isExist = false;
                                                                    if (item.identityCode === 'IC0001') return
                                                                    selectIdentityList.forEach((child) => {
                                                                        if (child.identityCode === item.identityCode) {
                                                                            isExist = true;
                                                                        }
                                                                    })
                                                                    return (
                                                                        // <li key={index} onClick={() => this.chooseIdentity(item)} >
                                                                        //     <span className={"checklogo " + (isExist ? "active" : "")} ></span>
                                                                        //     <span style={{ cursor: 'pointer' }}>{item.userTypeName}</span>
                                                                        // </li>
                                                                        <li>
                                                                            <LgCheckbox
                                                                                // className={index === 4 || item.label == '其他' ? "g006-form-1-item g006-form-1-item-other" : "g006-form-1-item"}
                                                                                key={index}
                                                                                checked={isExist}
                                                                                onChange={() => { this.chooseIdentity(item) }}
                                                                                value={index}
                                                                                label={item.userTypeName} />
                                                                        </li>

                                                                    )
                                                                }) :
                                                                ""
                                                        }
                                                        {/* <li onClick={() => this.chooseAll()}>
                                                            <span className={"checklogo " + (isChooseAll ? "active" : "")} ></span>
                                                            <span style={{ cursor: 'pointer' }}>全选</span>
                                                        </li> */}
                                                        <li>
                                                            <LgCheckbox
                                                                checked={isChooseAll}
                                                                onChange={() => { this.chooseAll() }}
                                                                value={""}
                                                                label={"全选"} />
                                                        </li>
                                                    </ul>
                                                </Scrollbars>
                                            </div>
                                        </div>
                                    </div>
                                </LgPopLayer>
                                {
                                    selectUserVisible ?
                                        <SelectUserModal
                                            className='select-user-item lg-skin-s2'
                                            title={'选择用户'}
                                            // groupUserType={['0', '1']}
                                            baseUrl={officePlatform[0].webSvrAddr ? officePlatform[0].webSvrAddr : ''}
                                            token={sessionStorage.getItem('token') || getQueryVariable('lg_tk')}
                                            visible={selectUserVisible}
                                            type={'edu'}
                                            schoolId={this.state.userInfo.eduId}
                                            getSelectResult={this.getSelectList}
                                            selectList={selectUserList}
                                            changeVisible={this.selectUserChange} />
                                        // <SelectUserModal
                                        // baseUrl={sysAddrInfo["264"]?.webSvrAddr}
                                        // maxLength={500}
                                        // type={'edu'}
                                        // visible={selectUserVisible}
                                        // zIndex={4000}
                                        // getSelectResult={getSelectList}
                                        // selectList={dateSelectUserList}
                                        // changeVisible={selectUserChange} />
                                        : ''
                                }
                                <div className={'content-right-bottom' + (noticeList.length === 0 ? ' empty-example' : '')}>
                                    {
                                        noticeList.length === 0 ?
                                            isSearch ?
                                                <LgEmpty className="empty-example-block" size="large" >未搜索到数据</LgEmpty>
                                                : <LgEmpty className="empty-example-block" size="large" /> :
                                            isManage == 1 ?
                                                <Base getNoticeList={this.getNoticeList} type={'noticeList'} toTop={this.toTop} deleteNotice={this.deleteNotice} openNoticeContent={(id) => this.openNoticeContent(id)}
                                                    callbackNotice={this.callbackNotice} noticeList={noticeList} editNotice={this.openRelease} ></Base>
                                                :
                                                <div className='no-manage-div'>
                                                    <Scrollbars autoHeight autoHeightMax={576} autoHide autoHideTimeout={100}>
                                                        <div className='no-manage-list'>
                                                            {
                                                                noticeList.map((item, index) => {
                                                                    return (
                                                                        <div className='no-manage-item' onClick={() => this.openNoticeContent(item.bulletinId)}>
                                                                            <div className='item-top'>
                                                                                <span className={'item-top-title ' + (item.readStatus == '0' ? 'no-read-item' : '')} title={item.title}>
                                                                                    {
                                                                                        item.haveAttachment == 1 ?
                                                                                            <i className='have-attachment'></i>
                                                                                            : ''
                                                                                    }
                                                                                    {item.title}</span>
                                                                                <span className='item-top-type'>{item.typeName}</span>
                                                                            </div>
                                                                            <div className='item-middle'>
                                                                                {this.removeTagsAndImages(item.content)}
                                                                            </div>
                                                                            <div className='item-bottom'>
                                                                                <span className='item-bottom-dep'><i className='dep-icon'></i>{item.departmentName}</span>
                                                                                <span className='item-bottom-read'><i className='read-icon'></i>{item?.readCount ? item?.readCount : ''}</span>
                                                                                <span className='item-bottom-time'><i className='time-icon'></i>{moment(item.releaseTime).format('YYYY-MM-DD HH:mm')}</span>
                                                                            </div>
                                                                        </div>
                                                                    )
                                                                })
                                                            }
                                                        </div>
                                                    </Scrollbars>
                                                </div>
                                    }
                                    <div className='pager-bottom' style={{ top: isManage == 1 ? '' : '645px' }}>
                                        {
                                            // Math.ceil(totalNoticeNum / pageSize) < 2 ? '' :
                                            isManage == 1 ?
                                                totalNoticeNum < 11 ? '' :
                                                    <LgPaginationA
                                                        total={Math.ceil(totalNoticeNum / pageSize)}
                                                        size="normal"
                                                        currentPage={pageNum}
                                                        onChangePage={this.changePageA}
                                                        pageSizeList={pageSizeList}
                                                        pageSizeIndex={0}
                                                        pageSizeSelect={this.pageSizeSelectA}
                                                        pageSizePosition={"bottom"}
                                                    ></LgPaginationA>
                                                : totalNoticeNum < 9 ? '' :
                                                    <LgPaginationA
                                                        total={Math.ceil(totalNoticeNum / pageSize)}
                                                        size="normal"
                                                        currentPage={pageNum}
                                                        onChangePage={this.changePageA}
                                                        pageSizeList={pageSizeList}
                                                        pageSizeIndex={0}
                                                        pageSizeSelect={this.pageSizeSelectA}
                                                        pageSizePosition={"bottom"}
                                                    ></LgPaginationA>
                                        }
                                    </div>
                                </div>
                            </div>
                        </div>
                    </LgBlockCard>
                }
            </LgBlockCardBox>
        );
    }
}
export default NoticeList;
